//
//  XXSpaceCell.m
//  XingXue
//
//  Created by XingXue on 2023.
//  Copyright © 2023 XingXue. All rights reserved.
//

#import "XXSpaceCell.h"

@implementation XXSpaceCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setData:(id)data delegate:(id)delegate {
    
    if ([data isKindOfClass:[NSDictionary class]]) {
        if ([data[@"data"] isKindOfClass:[XXSpaceCellModel class]]) {
            XXSpaceCellModel *model = data[@"data"];
            if (model.bagroundColor) {
                self.contentView.backgroundColor = model.bagroundColor;
            } else {
                self.contentView.backgroundColor = [UIColor clearColor];
            }
        }
    }
}

@end


#pragma mark - Model

@implementation XXSpaceCellModel

+ (XXSpaceCellModel *)ittemModelWithBagroundColor:(UIColor *)bagroundColor {
    XXSpaceCellModel *model = [XXSpaceCellModel new];
    model.bagroundColor = bagroundColor;
    return model;
}

@end
